package xyz.dbqf.smartdict.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import wordroid.activitys.Main;
import wordroid.activitys.Main222;
import wordroid.activitys.Test;
import wordroid.activitys.TestList;
import xyz.dbqf.smartdict.R;

public class XuanzeCikuFragment extends Fragment {

    private boolean mSearchCheck;
    private static final String TEXT_FRAGMENT = "TEXT_FRAGMENT";
    private TextView mTxtTitle;

    public static XuanzeCikuFragment newInstance(String text){
        XuanzeCikuFragment mFragment = new XuanzeCikuFragment();
        Bundle mBundle = new Bundle();
        mBundle.putString(TEXT_FRAGMENT, text);
        mFragment.setArguments(mBundle);
        return mFragment;
    }



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        View rootView = inflater.inflate(R.layout.fragment_main, container, false);

        mTxtTitle = (TextView) rootView.findViewById(R.id.txtTitle);
        mTxtTitle.setText("点击" +getArguments().getString(TEXT_FRAGMENT));

        rootView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
        return rootView;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onActivityCreated(savedInstanceState);
        mTxtTitle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(XuanzeCikuFragment.this.getActivity(), Main222.class);
                startActivity(intent);
            }
        });
    }
}
